<template>
  <div>
    <x-header :left-options="{showBack: false}" style='position: fixed;width:100%;top:0;z-index: 999'>借款申请详情</x-header>
    <div class="content">
      <div class="risk-title">工程保证金</div>
      <!-- <card :header="{title: ('企业信息') }"  v-if="information.pubprojecttype != 3 && information.pubprojecttype != 8">
                <p slot="content" class="card-padding">借款企业名称：{{information.dsfhggs1}}</p>
                <p slot="content" class="card-padding">所在行业：{{information.cszhy}}</p>
                <p slot="content" class="card-padding">公司实际控制人：{{information.csjkzr}}</p>
                <p slot="content" class="card-padding">营业执照编号：{{information.cborrbusicode}}</p>
                <p slot="content" class="card-padding">公司所在地：{{information.cgsszd}}</p>
                <p slot="content" class="card-padding">公司法人：{{information.cgsfr}}</p>
            </card> -->
      <div class="progresss" v-if="information.pubprojecttype != 3 && information.pubprojecttype != 8">
        <div class="sp-progress">企业信息

        </div>
        <div>
          <p slot="content" class="card-padding">借款企业名称：{{information.dsfhggs1}}</p>
          <p slot="content" class="card-padding">所在行业：{{information.cszhy}}</p>
          <p slot="content" class="card-padding">公司实际控制人：{{information.csjkzr}}</p>
          <p slot="content" class="card-padding">营业执照编号：{{information.cborrbusicode}}</p>
          <p slot="content" class="card-padding">公司所在地：{{information.cgsszd}}</p>
          <p slot="content" class="card-padding">公司法人：{{information.cgsfr}}</p>

        </div>
      </div>
      <div class="progresss-list" v-if="information.pubprojecttype == 3 || information.pubprojecttype == 8 || information.pubprojecttype == 9">
        <div class="sp-progress-list">
          <span>借款人信息</span>

          <x-icon type="ios-arrow-down" size="30" class="icons" @click="downclick" v-show="down"></x-icon>
          <x-icon type="ios-arrow-up" size="30" class="icons" @click="upclick" v-show="up"></x-icon>
        </div>
        <div class="rorrower" v-show="isdown">
          <p slot="content" class="card-padding">借款人姓名：{{information.ckhhzh}}</p>
          <p slot="content" class="card-padding">借款人手机号码：{{information.cjkrxm}}</p>
          <p slot="content" class="card-padding">婚姻状况：{{information.chyzk}}</p>
          <p slot="content" class="card-padding">性别：{{information.ckzrxb}}</p>
          <p slot="content" class="card-padding">身份证号码：{{information.fcardno}}</p>
          <p slot="content" class="card-padding">年龄：{{information.ckzrnl}}</p>
          <p slot="content" class="card-padding">借款人户籍地：{{information.hkszd}}</p>
          <p slot="content" class="card-padding">学历：{{information.cxlzk}}</p>
          <p slot="content" class="card-padding">工作城市：{{information.fjobcity}}</p>
          <p slot="content" class="card-padding">行业：{{information.szhy}}</p>
          <p slot="content" class="card-padding">职位：{{information.cKzrgw}}</p>
          <p slot="content" class="card-padding">企业性质：{{information.fgzxz}}</p>
          <p slot="content" class="card-padding">收入情况：{{information.cKzrnsr}}</p>
          <p slot="content" class="card-padding">有无房产：{{information.cywfc}}</p>
          <p slot="content" class="card-padding">现居住地址：{{information.fztxz}}</p>
          <p slot="content" class="card-padding">住房性质：{{information.fzfxz}}</p>
          <p slot="content" class="card-padding">房贷情况：{{information.cywfd}}</p>
          <p slot="content" class="card-padding">是否有车产：{{information.cywcc}}</p>
          <p slot="content" class="card-padding">车贷情况：{{information.cywcd}}</p>
          <p slot="content" class="card-padding">主体性质：{{information.fztxz}}</p>
          <p slot="content" class="card-padding">涉诉情况：{{information.cssqk}}</p>
          <p slot="content" class="card-padding">其他情况：{{information.cqtqk}}</p>
          <p slot="content" class="card-padding">其他借款：{{information.cqtjk}}</p>
          <p slot="content" class="card-padding">还款能力变化：{{information.chknlbh}}</p>
          <p slot="content" class="card-padding">逾期情况：{{information.cyqqk}}</p>
          <p slot="content" class="card-padding">信用情况：{{information.cxyzl}}</p>
          <p slot="content" class="card-padding">稳定性：{{information.cwdx}}</p>
          <p slot="content" class="card-padding">还款能力：{{information.chknl}}</p>

          <p slot="content" class="card-padding">偿债保障：{{information.cczbz}}</p>
          <p slot="content" class="card-padding">资产实力：{{information.czcsl}}</p>
          <p slot="content" class="card-padding">是否有社保：{{information.issb}}</p>
          <p slot="content" class="card-padding">是否有负债：{{information.isfz}}</p>
          <p slot="content" class="card-padding">在平台逾期次数：{{information.ptyqcs}}</p>
          <p slot="content" class="card-padding">欠税记录：{{information.qsjl}}</p>
          <p slot="content" class="card-padding">民事判决记录：{{information.mspjjl}}</p>
          <p slot="content" class="card-padding">强制执行记录：{{information.qzzxjl}}</p>

          <p slot="content" class="card-padding">行政处罚记录：{{information.xzcfjl}}</p>

          <p slot="content" class="card-padding">电信欠费记录：{{information.dxqfjl}}</p>

          <p slot="content" class="card-padding">评估价值：{{information.cpgjz}}</p>
          <p slot="content" class="card-padding">授信额度：{{information.fsxed}}</p>

          <p slot="content" class="card-padding">项目来源：{{information.cxmly}}</p>



        </div>
      </div>
      <div class="progresss-list" v-else>
        <div class="sp-progress-list">
          <span>借款人信息</span>

          <x-icon type="ios-arrow-down" size="30" class="icons" @click="downclick" v-show="down"></x-icon>
          <x-icon type="ios-arrow-up" size="30" class="icons" @click="upclick" v-show="up"></x-icon>
        </div>
        <div class="rorrower" v-show="isdown">
          <p slot="content" class="card-padding">借款人姓名：{{information.ckhhzh}}</p>
          <p slot="content" class="card-padding">借款人手机号码：{{information.cjkrxm}}</p>
          <p slot="content" class="card-padding">借款人所在公司岗位：{{information.ckzrgw}}</p>
          <p slot="content" class="card-padding">身份证号码：{{information.fcardno}}</p>
          <p slot="content" class="card-padding">性别：{{information.ckzrxb}}</p>
          <p slot="content" class="card-padding">年龄：{{information.ckzrnl}}</p>
          <p slot="content" class="card-padding">婚姻状况：{{information.chyzk}}</p>
          <p slot="content" class="card-padding">学历：{{information.cxlzk}}</p>
          <p slot="content" class="card-padding">工作城市：{{information.fjobcity}}</p>
          <p slot="content" class="card-padding">年收入：{{information.ckzrnsr}}</p>
          <p slot="content" class="card-padding">房产情况：{{information.cywfd}}</p>
          <p slot="content" class="card-padding">车产情况：{{information.cywcd}}</p>
          <p slot="content" class="card-padding">是否有社保：{{information.issb}}</p>
          <p slot="content" class="card-padding">是否有负债：{{information.isfz}}</p>
          <p slot="content" class="card-padding">主体性质：{{information.fztxz}}</p>
          <p slot="content" class="card-padding">涉诉情况：{{information.cssqk}}</p>
          <p slot="content" class="card-padding">其他情况：{{information.cqtqk}}</p>
          <p slot="content" class="card-padding">其他借款：{{information.cqtjk}}</p>
          <p slot="content" class="card-padding">还款能力变化：{{information.chknlbh}}</p>
          <p slot="content" class="card-padding">逾期情况：{{information.cyqqk}}</p>
          <p slot="content" class="card-padding">信用情况：{{information.cxyzl}}</p>
          <p slot="content" class="card-padding">稳定性：{{information.cwdx}}</p>
          <p slot="content" class="card-padding">还款能力：{{information.chknl}}</p>
          <p slot="content" class="card-padding">偿债保障：{{information.cczbz}}</p>
          <p slot="content" class="card-padding">资产实力：{{information.czcsl}}</p>
          <p slot="content" class="card-padding">评估价值：{{information.cpgjz}}</p>
          <p slot="content" class="card-padding">授信额度：{{information.fsxed}}</p>
          <p slot="content" class="card-padding">项目来源：{{information.cxmly}}</p>
        </div>
      </div>
      <div class="progresss" v-if="information.pubprojecttype == 9">
        <div class="sp-progress">车辆信息

        </div>
        <div>
          <p slot="content" class="card-padding">车辆品牌：{{information.cppp}}</p>
          <p slot="content" class="card-padding">车辆型号：{{information.fclxh}}</p>

          <p slot="content" class="card-padding">购买价格：{{information.gmj}}</p>
          <p slot="content" class="card-padding">行驶公里：{{information.gls}}</p>
          <p slot="content" class="card-padding">车辆数量：{{information.clcount}}</p>

        </div>
      </div>
      <div class="progresss" v-if="information.pubprojecttype == 3">
        <div class="sp-progress">车辆信息

        </div>
        <div> 
          <p slot="content" class="card-padding">车辆品牌：{{information.cppp}}</p>
          <p slot="content" class="card-padding">车辆型号：{{information.fclxh}}</p>

          <p slot="content" class="card-padding">购买价格：{{information.gmj}}</p>
          <p slot="content" class="card-padding">行驶公里：{{information.gls}}</p>
          <!-- <p slot="content" class="card-padding" >车辆数量：{{information.clcount}}</p> -->

        </div>
      </div>
      <div class="progresss" v-if="information.pubprojecttype == 8 || information.pubprojecttype == 7">
        <div class="sp-progress">房屋信息

        </div>
        <div>
          <p slot="content" class="card-padding">房屋面积：{{information.fcmj}}</p>
          <p slot="content" class="card-padding">房屋价值：{{information.fcjz}}</p>
          <p slot="content" class="card-padding">房屋所在地：{{information.fcszd}}</p>

        </div>
      </div>

      <div class="progresss" v-if="information.pubprojecttype == 3 || information.pubprojecttype == 8 || information.pubprojecttype == 9">
        <div class="sp-progress">认证信息

        </div>
        <div>
          <p slot="content" class="card-padding" v-if="information.hkbrz == 1">户口本：已认证</p>
          <p slot="content" class="card-padding" v-if="information.jhzrrz == 1">结婚证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.gzklsrz == 1">工资卡流水：已认证</p>
          <p slot="content" class="card-padding" v-if="information.qsdcrz == 1">亲属调查：已认证</p>

          <p slot="content" class="card-padding" v-if="information.fczrz == 1">房产证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.gtzrz == 1">国土资：已认证</p>
          <p slot="content" class="card-padding" v-if="information.clxszrz == 1">车辆行驶证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.cldjzrz == 1">车辆登记证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.cljqxrz == 1">车辆交强险：已认证</p>
          <p slot="content" class="card-padding" v-if="information.clsyxrz == 1">车辆商业保险：已认证</p>
          <p slot="content" class="card-padding" v-if="information.fcardNorz == 1">身份证信息：已认证</p>
          <p slot="content" class="card-padding" v-if="information.clxxrz == 1">车辆信息：已认证</p>
          <p slot="content" class="card-padding" v-if="information.gzzmrz == 1">工作证明：已认证</p>
          <p slot="content" class="card-padding" v-if="information.xybgrz == 1">征信报告：已认证</p>
          <p slot="content" class="card-padding" v-if="information.srzmrz == 1">收入证明：已认证</p>
          <p slot="content" class="card-padding" v-if="information.xxba == 1">信息备案：已认证</p>
          <p slot="content" class="card-padding" v-if="information.clxfs == 1">手机认证：已认证</p>

        </div>

      </div>

      <div class="progresss" v-else>
        <div class="sp-progress">认证信息

        </div>
        <div>
          <p slot="content" class="card-padding" v-if="information.hkbrz == 1">户口本：已认证</p>
          <p slot="content" class="card-padding" v-if="information.jhzrrz == 1">结婚证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.gzklsrz == 1">工资卡流水：已认证</p>
          <p slot="content" class="card-padding" v-if="information.fczrz == 1">房产证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.gtzrz == 1">国土资：已认证</p>
          <p slot="content" class="card-padding" v-if="information.swdjzrz == 1">税务登记证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.gsjypjrz == 1">公司经营票据：已认证</p>
          <p slot="content" class="card-padding" v-if="information.gssdrz == 1">公司实地认证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.fwsdrz == 1">房屋实地认证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.dywrz == 1">抵押物认证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.khhrz == 1">开户行：已认证</p>
          <p slot="content" class="card-padding" v-if="information.xybgrz == 1">信用报告：已认证</p>
          <p slot="content" class="card-padding" v-if="information.srzmrz == 1">收入证明：已认证</p>
          <p slot="content" class="card-padding" v-if="information.xxba == 1">信息备案：已认证</p>
          <p slot="content" class="card-padding" v-if="information.clxfs == 1">手机认证：已认证</p>
          <p slot="content" class="card-padding" v-if="information.qsdcrz == 1">亲属调查：已认证</p>
          <p slot="content" class="card-padding" v-if="information.jyxxrz == 1">经营信息认证：已认证</p>
        </div>

      </div>


      <div class="progresss">
        <div class="sp-progress">借款合同信息

        </div>
        <div v-for="item in contract" :key="item.index">
          <p slot="content" class="card-padding">合同号：{{item.contractId}}</p>
          <p slot="content" class="card-padding">借款金额：{{item.loanAmount}}</p>
          <p slot="content" class="card-padding">借款期限：{{item.loanAmountLimit}}</p>
          <p slot="content" class="card-padding" v-if="item.contractLinkSecond == null || item.contractLinkSecond == ''">借款合同：无</p>
          <p slot="content" class="card-padding" v-else>
            借款合同：
            <a :href="'http://192.168.3.71:8080/risk/'+item.contractLinkSecond" style="color:blue;text-decoration: underline;">合同附件</a>
          </p>
        </div>

      </div>
      <div class="progresss">
        <div class="sp-progress">代开户信息

        </div>
        <div v-if="information.pubprojecttype != 3 || information.pubprojecttype != 8">
          <p slot="content" class="card-padding">借款企业名称（代开户）：{{account.accountName}}</p>
          <!-- <p slot="content" class="card-padding">身份证号码：{{account.card}}</p> -->
          <p slot="content" class="card-padding">开户行：{{account.accountBank}}</p>
          <p slot="content" class="card-padding">开户省市：{{account.khCity}}{{account.khProvince}}</p>
          <p slot="content" class="card-padding">银行卡号：{{account.accountNumber}}</p>
          <p slot="content" class="card-padding">银行卡手机号码：{{account.legalTel}}</p>
          <!-- <p slot="content" class="card-padding">银行存管ID：{{account.cgId}}</p> -->


          <p slot="content" class="card-padding" v-if="information.pubprojecttype == 1">开户账户名：{{account.account_name}}</p>
          <p slot="content" class="card-padding" v-if="information.pubprojecttype == 1">开户银行：{{account.account_bank}}</p>
          <p slot="content" class="card-padding" v-if="information.pubprojecttype == 1">支行名称：{{account.branch_name}}</p>
          <p slot="content" class="card-padding" v-if="information.pubprojecttype == 1">开户账号：{{account.account_number}}</p>
          <p slot="content" class="card-padding" v-if="information.pubprojecttype == 1">法人手机号码：{{account.legal_tel}}</p>
          <p slot="content" class="card-padding" v-if="information.pubprojecttype == 1">企业联系人手机号码：{{account.enterprise_tel}}</p>
          <p slot="content" class="card-padding" v-if="information.pubprojecttype == 1">企业联系人邮箱：{{account.enterprise_email}}</p>
          <p slot="content" class="card-padding" v-if="information.pubprojecttype == 1">企业固定电话：{{account.fixation_tel}}</p>
        </div>

      </div>

      <div class="progresss">
        <div>
          <div class="sp-progress">附件信息</div>
        </div>
        <div class="nums">共有{{imgpic.length}}个图片（可点击放大）</div>
        <div>
          <img class="previewer-demo-img info" v-for="(item, index) in imgpic" :src="item.url" width="100" @click="show(index)">
          <div v-transfer-dom>
            <previewer :list="imgpic" ref="previewer"></previewer>
          </div>
          <!-- <swiper :list="imgpic" v-model="demo02_index" @click="lists()"></swiper> -->
        </div>
        <div class="nums">共有{{picList.length}}个文件（可下载预览）</div>
        <div v-for="(item, index) in picList" class="fj-info">

          <ul>
            <li class="jg-list">
              <span class="firename">文件名:</span>
              <span class="fireinfo" @click="download(item)">{{item.name}}</span>
            </li>
          </ul>

        </div>

      </div>
      <div class="progresss" v-if="approvalProcess.length != 0">
        <div class="sp-progress">审批过程</div>
        <div class="sp-sroll">
          <div class="sp-content clearfix" v-for="item in approvalProcess" :key="item.index">
            <div class="sp-left">
              <x-icon type="ios-circle-outline" size="15" class="ries"></x-icon>
              <div class="line"></div>
            </div>
            <div class="sp-right">
              <div>{{item.handelTime}}</div>
              <ul>
                <li>审批节点:{{item.handelRes}}</li>
                <li>处理部门:{{item.handleDep}}</li>
                <li>处理人:{{item.handelName}}</li>
                <li>备注:{{item.handelRes}}</li>
              </ul>
            </div>
          </div>
        </div>

      </div>

    </div>
    <div class="footer">
      <div class="button">
        <flexbox v-if="isReviewPassed">
          <flexbox-item>
            <x-button type="primary" @click.native='adopt' :disabled="ispass">{{passed}}</x-button>
          </flexbox-item>
          <flexbox-item>
            <x-button type="warn" @click.native='reject(9)' :disabled="isretrunOver">{{retrunOver}}</x-button>
          </flexbox-item>
          <flexbox-item>
            <x-button type="warn" @click.native='reject(8)' :disabled="isretrunOver">拒件</x-button>
          </flexbox-item>
        </flexbox>
        <flexbox v-else>
          <flexbox-item>
            <x-button type="warn" disabled>{{examineAfterState}}</x-button>
          </flexbox-item>
        </flexbox>
      </div>
    </div>
    <!-- <div v-transfer-dom>
            <confirm v-model="show"
            :title="('撤回通知')"
            @on-cancel="onCancel"
            @on-confirm="onConfirm"
            >
              <p style="text-align:center;">{{ ('该申请已被申请人撤回') }}</p>
            </confirm>
          </div> -->
    <div v-transfer-dom>
      <confirm v-model="isAdopt" :title="('是否确认审核通过')" @on-cancel="onCancel" @on-confirm="onConfirm" @on-show="onShow" @on-hide="onHide">
        <!-- <p style="text-align:center;">{{ ('Are you sure?') }}</p> -->
      </confirm>
    </div>
    <div v-transfer-dom>
      <confirm v-model="show5" show-input ref="confirm5" :title="('请输入驳回原因')" @on-cancel="onCancel" @on-confirm="onRefuseConfirm" @on-show="onShow5"
        @on-hide="onHide">
      </confirm>
    </div>
    <div v-transfer-dom>
      <confirm v-model="showRefuseFile" show-input ref="confirm5" :title="('请输入拒件原因')" @on-cancel="onCancel" @on-confirm="onRefuseConfirm" @on-show="onShow5"
        @on-hide="onHide">
      </confirm>
    </div>
    <!--
    <toast v-model="show1" @on-hide="onHide">{{message}}</toast>
    <toast v-model="warn" type="warn">{{warnmessage}}</toast> -->

  </div>
</template>
<script>
import {
  Card,
  XHeader,
  Tabbar,
  TabbarItem,
  XButton,
  Flexbox,
  FlexboxItem,
  Flow,
  FlowState,
  FlowLine,
  Swiper,
  Confirm,
  Previewer,
  TransferDom
} from "vux";
import { HDetailService } from "../../shared/hdetail.service.js";

import { getString } from "../../utils/string.js";

export default {
  directives: {
    TransferDom
  },
  components: {
    Card,
    XHeader,
    Tabbar,
    TabbarItem,
    XButton,
    Flexbox,
    FlexboxItem,
    Flow,
    FlowState,
    FlowLine,
    Swiper,
    Confirm,
    Previewer
  },
  data() {
    return {
      // 请求
      hDetailService: {},
      demo02_index: 1,
      isAdopt: false,
      isdown: false,
      down: true,
      up: false,
      picList: [],
      show1: false,
      show5: false,
      // 6/13
      showRefuseFile: false,
      message: "",
      retrunOver: "驳回",
      passed: "审核通过",
      ispass: false,
      isretrunOver: false,
      warn: false,
      warnmessage: "",
      imgAll: [],
      //参数

      params: {
        rowid: this.$route.query.rowid,
        id: this.$route.query.id,
        type: this.$route.query.type,
        userId: this.$route.query.userId,
        handelMes: ""
      },
      //借款合同信息
      contract: "",
      //企业
      information: {},
      //代开户
      account: {},
      imgpic: [],
      //审批过程
      approvalProcess: [],
      demo02_index: 0,
      imgUrl: "",
      // 6/12新增
      // 接口返回的审核状态
      audState: 0,
      audStateMap: {
        "0": 1,
        "1": 2,
        "4": 10,
        "5": 6,
        "10": 11,
        "11": 5
      },
      refuseState: 0,
      // 链接截取的审核状态
      examineState: 0,
      // 用来判断按钮5分钟内只请求一次接口
      identify: 0,
      identifyOther: 0,
      identifyOther2: 0
    };
  },
  mounted() {
    //   this.getPassStatus();
    this.createService();
    this.getDetail();
    this.baseUrl();
  },
  created() {
    this.getFirstStaFromUrl();
  },
  computed: {
    examineAfterState() {
      let examineAfterState = null;
      if (this.audState == 8) {
        examineAfterState = "已拒件";
      } else if (this.audState == 9) {
        examineAfterState = "已驳回";
      } else {
        examineAfterState = "已审核通过";
      }
      return examineAfterState;
    },
    // 是否审核通过
    isReviewPassed() {
      // 前后的state值不一样的话 就表示审核通过
      return this.examineState == this.audState;
    }
  },
  methods: {
    getFirstStaFromUrl() {
      this.examineState = getString("sta");
    },
    createService() {
      this.hDetailService = new HDetailService();
    },
    baseUrl() {
      let [isTest, origin] = [null, window.document.location.origin];
      if (origin.indexOf("36.7") > -1 || origin.indexOf("localhost") > -1) {
        isTest = true;
      } else {
        isTest = false;
      }
      if (isTest) {
        this.imgUrl = "http://192.168.3.71:8080/risk";
      } else {
        this.imgUrl = "http://report.wsloan.com:8888/risk";
      }
    },
    show(index) {
      this.$refs.previewer.show(index);
    },

    //状态

    async getPassStatus() {
      console.log(this.params);
      let { data } = await this.$get({
        api: "/risk/api/risk/lsJkrxx/getPassStatus",
        data: {
          id: this.params.rowid
        }
      });
      if (data.code == 0) {
        if (data.result.audState == 5) {
          this.warn = true;
          this.warnmessage = "该信息已被撤回";

          setTimeout(() => {
            this.$router.go(-1);
          }, 2000);
        }
        if (data.result.audState != 0) {
          console.log();
          this.ispass = true;
          this.isretrunOver = true;
        } else {
          this.ispass = false;
          this.isretrunOver = false;
        }
      }
    },
    async getDetail() {
      // 详情展示
      let { data } = await this.hDetailService.loanApply({
        jkrid: getString("jkrid"),
        rowid: getString("rowid"),
        type: getString("type"),
        userType: getString("userType"),
        sysId: getString("sysId"),
        sta: getString("sta")
      });
      data = JSON.parse(data);
      if (data.code == 0) {
        this.information = data.result.jkrxx;
        this.account = data.result.bankInfo;
        this.contract = data.result.xyLoanContractList;
        this.audState = data.result.loanApply.audState;
        this.approvalProcess = data.result.spList;
        this.imgpic = data.result.strs;
        this.imgpic.forEach((k, v) => {
          k.src = k.url;
        });

        this.picList = data.result.files;
      } else {
        this.$vux.toast.show({ type: "warn", text: data.message });
      }
    },

    downclick() {
      if (this.isdown == true) {
        this.isdown = false;
      } else {
        this.isdown = true;
      }
      if (this.down == true) {
        this.up = true;
        this.down = false;
      } else {
        this.up = false;
        this.down = true;
      }
    },
    upclick() {
      if (this.isdown == true) {
        this.isdown = false;
      } else {
        this.isdown = true;
      }
      if (this.up == true) {
        this.down = true;
        this.up = false;
      } else {
        this.down = false;
        this.up = true;
      }
    },
    demo01_onIndexChange(index) {
      console.log(index);
      // this.demo01_index = index
    },
    adopt() {
      this.isAdopt = true;
    },
    // type 9 驳回 8 拒件
    reject(type) {
      this.refuseState = type;
      if (type == 9) {
        this.show5 = true;
      } else if (type == 8) {
        this.showRefuseFile = true;
      }
    },
    onCancel() {
      // console.log('取消')
    },
    //审核
    async onConfirm() {
      if (this.identify) {
        return;
      }
      let { data } = await this.hDetailService.examine({
        jkrid: getString("jkrid"),
        rowid: getString("rowid"),
        type: getString("type"),
        userType: getString("userType"),
        sysId: getString("sysId"),
        state: this.audStateMap[this.audState],
        mes: ""
      });
      this.identify = setTimeout(() => {
        this.identify = 0;
      }, 300000);
      this.resultConfirm(data);
    },
    //驳回和拒件
    async onRefuseConfirm(value) {
      if (this.refuseState == 9) {
        if (this.identifyOther) {
          return;
        }
        this.identifyOther = setTimeout(() => {
          this.identifyOther = 0;
        }, 300000);
      }
      if (this.refuseState == 8) {
        if (this.identifyOther2) {
          return;
        }
        this.identifyOther2 = setTimeout(() => {
          this.identifyOther2 = 0;
        }, 300000);
      }
      let { data } = await this.hDetailService.examine({
        jkrid: getString("jkrid"),
        rowid: getString("rowid"),
        type: getString("type"),
        userType: getString("userType"),
        sysId: getString("sysId"),
        state: this.refuseState,
        mes: value
      });
      this.resultConfirm(data);
    },
    resultConfirm(data) {
      data = JSON.parse(data);
      if (data.code === 0) {
        this.$vux.toast.show({ type: "success", text: "操作成功~" });
        this.getDetail();
      } else {
        this.$vux.toast.show({ type: "warn", text: data.message });
      }
    },
    onShow5() {
      // console.log(12)
      // this.$refs.confirm5.setInputValue('default')
    },
    onHide() {
      // console.log('on hide')
    },
    onShow() {
      console.log("on show");
    },
    moreClick() {
      this.picList = this.imgAll;
    },
    //附近预览
    download(item) {
      // window.location.href="http://report.wsloan.com:8888/risk"+item.url;
      window.location.href = item.url;
    },
    //合同附件预览
    appendices(item) {
      // console.log(123)
    },
    demo01_onIndexChange(index) {
      this.demo01_index = index;
    }
  }
};
</script>
<style lang="scss" scoped>
@import "../../style/variable.scss";
.card-padding {
  padding: 8px 15px;
}

.content {
  margin-bottom: Px(120);
}

.risk-title {
  text-align: center;
  margin-top: Px(30);
}

.footer {
  position: fixed;
  bottom: 0;
  /* height:Px(100); */
  background: #e5e5e5;
  width: 100%;
}

.button {
  margin: Px(10);
}

.line {
  height: Px(200);
  width: Px(4);
  background: #e5e5e5;
  margin-left: Px(30);
}

.ries {
  margin-left: Px(20);
  /* margin-top:Px(10); */
}

.progresss {
  margin-top: Px(20);
  border-top: Px(2) solid #e5e5e5;
  border-bottom: Px(2) solid #e5e5e5;
  padding-bottom: Px(30);
}

.progresss-list {
  margin-top: Px(20);
  border-top: Px(2) solid #e5e5e5;
}

.sp-progress-list {
  height: Px(80);
  line-height: Px(80);
  border-bottom: Px(2) solid #e5e5e5;
  /* color:#999999; */
  margin-left: Px(30);
  font-size: Px(30);
  font-weight: bold;
}

.sp-progress {
  height: Px(80);
  line-height: Px(80);
  border-bottom: Px(2) solid #e5e5e5;
  /* color:#999999; */
  margin-left: Px(30);
  margin-bottom: Px(30);
  font-size: Px(30);
  font-weight: bold;
}

.sp-content {
  padding: 0 15px;
}

.sp-sroll {
  height: Px(500);
  overflow-x: scroll;
}

.sp-left {
  float: left;
}

.sp-right {
  margin-left: Px(80);
  ul {
    li {
      margin: Px(20) 0;
    }
  }
}

.info {
  width: Px(167);
  height: Px(100);
  padding: 0 Px(10);
  /* margin-top:Px(20);
     border-top:Px(2) solid #E5E5E5;
     border-bottom: Px(2) solid #E5E5E5;
     padding-bottom: Px(30); */
}

.more {
  text-align: center;
  float: right;
  background: #e5e5e5;
  width: Px(167);
  height: Px(100);
  line-height: Px(100);
  border: Px(2) solid #ccc;
  margin-right: Px(10);
}

.rorrower {
  height: Px(550);
  /* overflow: hidden; */
  overflow-x: scroll;
}

.icons {
  float: right;
  margin-top: Px(6);
  padding-left: Px(200);
  padding-right: Px(40);
}

.fj-info {
  /* margin:Px(0) Px(20); */
  /* width:Px(700);
    height:Px(100);
    overflow: hidden;
    text-overflow:ellipsis;
    white-space:nowrap; */
  /* -webkit-line-clamp: 2; */
  /* display: inline-block; */
  /* font-size:Px(14); */
}

.jg-list {
  width: Px(650);
  height: Px(40);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  padding-left: Px(10);
}

.firename {
  /* font-size:Px(30); */
}

.fireinfo {
  color: blue;
  text-decoration: underline;
}

.download {
  position: absolute;
  color: #586c94;
  top: Px(30);
  right: Px(30);
  /* font-size:Px(14);
    padding-top:Px(14);
    padding-left:Px(20); */
}

a {
  display: inline-block;
}

.nums {
  padding: Px(10);
}

.weui-panel__hd {
  color: #000 !important;
}

.clearfix:after {
  content: "";
  display: block;
  visibility: hidden;
  height: 0;
  clear: both;
}

.clearfix {
  zoom: 1;
}

.weui-btn {
  font-size: 17px;
}
</style>
